#include <stdio.h>
int main()
{
    double num;
    scanf("%lf", &num);
    if (num < 0)
    {
        printf("Invalid Value!");
    }else if(num > 0 & num < 50)
    {
        printf("cost = %.2f", 0.53 * num);
    }else
    {
        printf("cost = %.2f", 0.53 * 50 + 0.58 * (num - 50));
    }
    return 0;
}